﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace HP.Cachalote.WPF.Converters
{
    /// <summary>
    /// Since DueDate is nullable DateTime and cannot be customized by xaml directly.
    /// </summary>
    public class DueDateConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value != null)
            {
                return "DueDate: " + ((DateTime)value).ToShortDateString();
            }
            else
            {
                return string.Empty;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
